<!--  -->
<template>
  <div>
      <swiper :options="swiperOption" ref="mySwiper" class="swiper">
			<!-- 这部分放你要渲染的那些内容 -->
			<swiper-slide v-for="(item, index) in bannerImg" :key="index">
         <img :src="item.thumb" alt="">
			</swiper-slide>
     
			<!-- 这是轮播的小圆点 -->
			<div class="swiper-pagination" slot="pagination"></div>

		</swiper>
    <div class="header">
      <span class="s_left" @click="tocity()"> {{cityName}} <i class="iconfont">&#xe600;</i> </span>
      <span class="s_center"> <i class="iconfont">&#xe63d;</i> <input type="text" placeholder="最美秋色"></span>
      <span class="s_right"> <i class="iconfont">&#xe626;</i></span>
    </div>
  </div>
</template>

<script>
import { swiper, swiperSlide } from "vue-awesome-swiper";
import { mapState } from "vuex";
export default {
  computed: mapState(["cityName"]),
  props: ["bannerImg"],
  components: {
    swiper,
    swiperSlide
  },
  methods:{
    tocity(){
      this.$router.push("/city")
    }
  },
  data() {
    return {
      swiperOption: {
        loop: true,
        autoplay:true,
        pagination: {
          el: ".swiper-pagination",
          
        }
      }
    };
  },
   
};
</script>
<style scoped>
.swiper-container {
  width: 100%;
  height: 5.8rem;
}
.swiper-slide img {
  width: 100%;
  height: 100%;
}
.header {
  width: 100%;
  height: 40px;
  position: absolute;
  left: 0;
  top: 10px;
  z-index: 66;
  display: flex;
  color: #fff;
  align-items: center;
}
.s_left {
  margin-left: 0.2666666rem;
  font-size: 16px;
  padding-right: 0.26666rem;
}
.s_right {
  margin-right: 0.26666666rem;
  padding-left: 0.36666rem;
}
.s_right i {
  font-size: 0.6rem;
}
.s_center {
  flex: 1;
  background: #fff;
  padding: 2px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  height: 25px;
}
.s_center i {
  color: #333;
  margin-left: 0.2rem;
  margin-right: 0.2rem;
}
.s_center input {
  border: none;
  outline: none;
}
.swiper-container-horizontal >>> .swiper-pagination-bullets .swiper-pagination-bullet {
    margin: 0 4px;
    background: #fff;
}
</style>